"use strict";
import dialogView from "./index.html";
import "./index.less";
export default class DyDialog {
    constructor(pic, type) {
        this.pic = pic;
        this.type = type;
        this.body = $("body");
        this.compiled = _.template(dialogView);
        this.render();
        this.registerEvents();
    }
    registerEvents() {
        let _this = this;
        this.body.delegate(".tips_btn", "click", function() {
            _this.isVisible = false;
            $(".layer2").hide();
            //关闭弹窗
            //点播 显示视频 关闭占位
            //直播 显示视频 关闭占位
            //待播 无需操作
            if (_this.type != 'waiting') {
                $("#live_video").removeClass('hide');
                $("#live_video_zw").addClass('hide');
            }

        });
    }
    render() {
        let _this = this;
        let dialogHtml = this.compiled({
            pic: this.pic,
            isVisible: true
        });
        //显示弹窗
        //点播 关闭视频 显示占位
        //直播 关闭视频 显示占位
        //待播  无需操作
        if (_this.type != 'waiting') {
            $("#live_video").addClass('hide');
            $("#live_video_zw").removeClass('hide');
        }
        this.body.append(dialogHtml);
    }
    set location(value) {
        $(".J_modal_mask").css({
            "height": value.viewPortSize.height + value.scrollSize.scrollY + 10
        });
    }
}